package com.zw.chat.repository;

import com.zw.chat.domain.ChatSession;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

public interface ChatSessionRepository extends MongoRepository<ChatSession, String> {

    @Query("{'creatAt._id' : ?0}")
    List<ChatSession> queryChatSession(String userId);

    @Query("{'creatAt._id' : ?0}")
    List<ChatSession> queryChatSession(String userId, Pageable pageable);
}
